package io.renren.modules.shop.service.impl;

import io.renren.modules.shop.entity.ProComByCusEntity;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.shop.dao.ProductCommentDao;
import io.renren.modules.shop.entity.ProductCommentEntity;
import io.renren.modules.shop.service.ProductCommentService;

import javax.annotation.Resource;


@Service("productCommentService")
public class ProductCommentServiceImpl extends ServiceImpl<ProductCommentDao, ProductCommentEntity> implements ProductCommentService {

    @Resource
    ProductCommentDao productCommentDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ProductCommentEntity> page = this.page(
                new Query<ProductCommentEntity>().getPage(params),
                new QueryWrapper<ProductCommentEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<ProComByCusEntity> commentList(Long id) {
        return productCommentDao.commentList(id);
    }

}
